package whf.framework.datasource;

import java.io.Serializable;

import org.jdom.Element;

import whf.framework.exception.PropertyException;

/**
 * @author king
 * @modify 2007-12-13 下午12:34:00
 */
public interface DataRow {

	/**
	 * @return 获取当前对象主键
	 */
	Serializable getPrimaryKey();
	
	/**
	 * @return 获取当前对象显示名称
	 */
	String getDisplayName();
	
	/**
	 * 获取当前行的任意属性
	 * @param propertyName 指定属性名称
	 * @return
	 */
	Object getProperty(String propertyName) throws PropertyException;
	
	/**
	 * 获取属性的显示
	 * @param propertyName
	 * @return
	 * @throws PropertyException
	 */
	String getPropertyDisplay(String propertyName) throws PropertyException;
	
	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param propertyName
	 * @param value
	 * @throws PropertyException
	 */
	void setProperty(String propertyName, Object value) throws PropertyException;
	
	/**
	 * @modify wanghaifeng Aug 26, 2006 10:18:16 AM
	 * @param propertyName
	 * @param propertyType
	 * @param value
	 * @throws PropertyException
	 */
	void setProperty(String propertyName, Class propertyType, String value) throws PropertyException;
	
	/**
	 * @return xml element
	 * @throws PropertyException
	 */
	public Element toXmlElement() throws PropertyException ;
}
